<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="java.util.*" %>
<%@ page import="org.swim.entity.Notification" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>View Notifications</title>
	<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
</head>
<body>
	<%@ include file="NavBar.jsp" %>
	<div class="container">
	<h1>View Notifications</h1>
		<% 
			if ((Boolean)request.getAttribute("areThereNotifications")==true) {
				List<Notification> notifications = (List<Notification>) request.getAttribute("notifications");  
				for (Notification current:notifications) {
		%>
				<p><% out.print(current.getText()); %> 
				<a href="RemoveNotification?id=<% out.print(current.getNotificationID()); %>"><button class="btn btn-mini btn-danger" type="button">Remove</button></a></p>
		<%		
				} %>
				<a href="RemoveAllNotifications"><button class="btn btn-danger" type="button">Remove All Notifications</button></a>	
		<% 	} else {	%>
				<div class="alert alert-info"><strong>No notifications:</strong> there are no notifications for you</div>
		<% 	} %>
	</div>
</body>
</html>